﻿<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <link href="../jquery/themes/default/easyui.css" rel="stylesheet" />
    <link href="../jquery/themes/icon.css" rel="stylesheet" />
    <link href="../jquery/demo/demo.css" rel="stylesheet" />
    <script src="../jquery/jquery.min.js"></script>
    <script src="../jquery/jquery.easyui.min.js"></script>
    <script src="../jquery/locale/easyui-lang-zh_CN.js"></script>
	<meta charset="utf-8" />
</head>
<body>
    <input id="cc" value="001">
   
  

<script type="text/javascript">
    $('#cc').combo({
        required: true,
        multiple: true
    });

    $(function () {
        $('#box').combo({
            required: true,    //不能为空
            multiple: false     //是否支持多选
        });
        $('#food').appendTo($('#box').combo('panel'));  //将下拉区块添加到下拉框里
        $('#food input').click(function () {
            var v = $(this).val();    //获取到选择的value值
            var s = $(this).next('span').text(); //获取span里的内容
            //将value值添加到组件value里，将span里的内容添加是组件输入框，最后关闭下拉面板
            $('#box').combo('setValue', v).combo('setText', s).combo('hidePanel');
        })
    });
</script>
</body>
</html>
